    /********************************************************/
    /*                                                      */
    /*                                                      */
    /*         Copyright (C), 1993  SEIKO EPSON Corp.       */
    /*         ALL RIGHTS RESERVED                          */
    /*                                                      */
    /*                                                      */
    /*  file name : fsetpos.c                               */
    /*                                                      */
    /*  Revision history                                    */
    /*      93/12/17    first release       S.Akaiwa        */
    /*      97/3/17	modified	    T.Katahira	    */
    /*			change function declaration	    */
    /*					to the ANSI style   */
    /*                                                      */
    /********************************************************/

#ifdef      UNIX
#include    "stdio.h"
#include    "smcvals.h"
#include    "errno.h"
#else
#include    <stdio.h>
#include    <smcvals.h>
#include    <errno.h>
#endif

int
fsetpos(FILE * fiStrmP, const fpos_t * tdPosAreaP)

    /********************************************************/
    /*                                                      */
    /*  This is dummy function.                             */
    /*  If stdin, stdout or stderr is specified by fiStrmP, */
    /*  and 0 is specified by tdPosAreaP, the fsetpos       */
    /*  function returns 0. Otherwise, this function        */
    /*  returns EOF.                                        */
    /*  If stdio is specified by fiStrmP, and 0 is not      */
    /*  specified by tdPosAreaP, "Invalid argument" is set  */
    /*  to the errno.                                       */
    /*  If successful, effect of the ungetc function is     */
    /*  cleared for same stream.                            */
    /*                                                      */
    /*      RETURN  0   ... Success                         */
    /*              EOF ... Error                           */
    /*                                                      */
    /*  <ANSI>                                              */
    /*      The fsetpos function sets the file position.    */
    /*                                                      */
    /*      RETURN  0   ... Success                         */
    /*              EOF ... Error                           */
    /*                                                      */
    /********************************************************/

    /* FILE    *fiStrmP    ;       pointer to target stream */
    /* const fpos_t  *tdPosAreaP ;       position indicator */
    {
     if(_ISSTDIO(fiStrmP)){                 /* stream stdio */
        if(*tdPosAreaP == 0){                 /* position 0 */
           fiStrmP->_flg = _UGETN;/* clear effect of ungetc */
           return   (int)0;                   /* successful */
        }
        else {
           errno = EINVAL; /* set invalid argument to errno */
        }
     }
	 else {
		 fseek(fiStrmP, *tdPosAreaP, 0);	// TODO: add error check
		 return 0;
	 }
     return (int)EOF;                       /* error return */
    }

